import requests
import logging

class Test_A3mall():
    token1=""
    # 登录
    def test_login(self):
        url="http://10.59.9.14:7003/api/public/login"
        data={
  "username": "19064013675",
  "password": "123456"
}
        r=requests.post(url=url,json=data)
        print("登录成功",r.json())

        Test_A3mall.token1="Bearer "+r.json()['data']['token']
        print(Test_A3mall.token1)
        assert "黑金会员" not in r.json()
    # 进入我的地址
    def test_a(self):
        url="http://10.59.9.14:7003/api/ucenter/address/list"
        tou={"auth-token":Test_A3mall.token1}
        r=requests.get(url=url,headers=tou)
        print("我的地址列表",r.json())
    #添加地址页面
    def test_addf(self):
        url="http://10.59.9.14:7003/api/ucenter/address?id=293&client_type=0"
        tou = {"auth-token": Test_A3mall.token1}
        r = requests.get(url=url, headers=tou)
        print(r.json())
    # 提交
    def test_save2(self):
        url="http://10.59.9.14:7003/api/ucenter/address/save"
        data={
  "id": "293",
  "client_type": "0",
  "name": "66",
  "tel": "19064013675",
  "province": "北",
  "county": "昌平区",
  "city": "北京市",
  "areaCode": [
    1,
    2,
    13
  ],
  "addressDetail": "南口街55号",
  "is_default": 0
}
        tou = {"auth-token": Test_A3mall.token1}
        r=requests.post(url=url,json=data,headers=tou)
        print(r.json())
    def test_save3(self):
        url="http://10.59.9.14:7003/api/ucenter/address/save"
        data={
  "id": "293",
  "client_type": "0",
  "name": "66",
  "tel": "19064013675",
  "province": "北京市",
  "county": "昌平区",
  "city": "北京市",
  "areaCode": [
    1,
    2,
    13
  ],
  "addressDetail": "南口街55号",
  "is_default": 0
}
        tou = {"auth-token": Test_A3mall.token1}
        r=requests.post(url=url,json=data,headers=tou)
        print(r.json())

    def test_save4(self):
        url = "http://10.59.9.14:7003/api/ucenter/address/save"
        data = {
                "id": "293",
                "client_type": "0",
                "name": "66",
                "tel": "19064013675",
                "province": "北京市",
                "county": "昌平区",
                "city": "北京市",
                "areaCode": [
                    1,
                    2,
                    13
                ],
                "addressDetail": "南口街55号",
                "is_default": 0
            }
        tou = {"auth-token": Test_A3mall.token1}
        r = requests.post(url=url, json=data, headers=tou)
        print(r.json())

    def test_save5(self):
        url="http://10.59.9.14:7003/api/ucenter/address/save"
        data={
  "id": "293",
  "client_type": "0",
  "name": "66",
  "tel": "19064013675",
  "province": "北京市",
  "county": "昌平区",
  "city": "北京市",
  "areaCode": [
    1,
    2,
    13
  ],
  "addressDetail": "南口街55号",
  "is_default": 0
}
        tou = {"auth-token": Test_A3mall.token1}
        r=requests.post(url=url,json=data,headers=tou)
        print(r.json())

    def test_save6(self):
        url = "http://10.59.9.14:7003/api/ucenter/address/save"
        data = {
                "id": "293",
                "client_type": "0",
                "name": "66",
                "tel": "19064013675",
                "province": "北京市",
                "county": "昌平区",
                "city": "北京市",
                "areaCode": [
                    1,
                    2,
                    13
                ],
                "addressDetail": "南口街55号",
                "is_default": 0
            }
        tou = {"auth-token": Test_A3mall.token1}
        r = requests.post(url=url, json=data, headers=tou)
        print(r.json())

        def test_save7(self):
            url = "http://10.59.9.14:7003/api/ucenter/address/save"
            data = {
                    "id": "293",
                    "client_type": "0",
                    "name": "66",
                    "tel": "19064013675",
                    "province": "北京市",
                    "county": "昌平区",
                    "city": "北京市",
                    "areaCode": [
                        1,
                        2,
                        13
                    ],
                    "addressDetail": "南口街55号",
                    "is_default": 0
                }
            tou = {"auth-token": Test_A3mall.token1}
            r = requests.post(url=url, json=data, headers=tou)
            print(r.json())

    def test_save8(self):
        url = "http://10.59.9.14:7003/api/ucenter/address/save"
        data = {
                    "id": "293",
                    "client_type": "0",
                    "name": "66",
                    "tel": "19064013675",
                    "province": "北京市",
                    "county": "昌平区",
                    "city": "北京市",
                    "areaCode": [
                        1,
                        2,
                        13
                    ],
                    "addressDetail": "南口街55号",
                    "is_default": 0
                }
        tou = {"auth-token": Test_A3mall.token1}
        r = requests.post(url=url, json=data, headers=tou)
        print(r.json())
    def test_save9(self):
        url="http://10.59.9.14:7003/api/ucenter/address/save"
        data={
  "id": "293",
  "client_type": "0",
  "name": "66",
  "tel": "19064013675",
  "province": "北京市",
  "county": "昌平区",
  "city": "北京市",
  "areaCode": [
    1,
    2,
    13
  ],
  "addressDetail": "南口街55号",
  "is_default": 0
}
        tou = {"auth-token": Test_A3mall.token1}
        r=requests.post(url=url,json=data,headers=tou)
        print(r.json())
    def test_save10(self):
        url="http://10.59.9.14:7003/api/ucenter/address/save"
        data={
  "id": "293",
  "client_type": "0",
  "name": "66",
  "tel": "19064013675",
  "province": "北京市",
  "county": "昌平区",
  "city": "北京市",
  "areaCode": [
    1,
    2,
    13
  ],
  "addressDetail": "南口街55号",
  "is_default": 0
}
        tou = {"auth-token": Test_A3mall.token1}
        r=requests.post(url=url,json=data,headers=tou)
        print(r.json())